package com.ccb.lms.dao;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;


import com.ccb.lms.dto.ReaderBorrowCopyBookAuthority;

import com.ccb.lms.dto.ReaderBorrowHistoryDto;

import com.ccb.lms.model.Reader;
import com.ccb.lms.util.BasePage;

public interface IReaderDAO {

	/**
	 * 验证登陆
	 * @param reader
	 * @return
	 * @throws SQLException
	 */
	public boolean isLogin(Reader reader) throws SQLException;   
	
	/**
	 * 增加一条记录
	 * @param reader
	 * @return
	 * @throws SQLException
	 */
	public boolean insertReader(Reader reader) throws SQLException;   
	
	/**
	 * 删除一条记录
	 * @param readerNO
	 * @return
	 * @throws SQLException
	 */
	public boolean deleteReader(Integer readerNO) throws SQLException;
	
	/**
	 * 更新一条记录
	 * @param reader
	 * @return
	 * @throws SQLException
	 */
	public boolean updateReader(Reader reader) throws SQLException;   
	
	/**
	 * 查询所有reader记录
	 * @return
	 * @throws SQLException
	 */
	public List<Reader> getAllReaders() throws SQLException; 
	
	/**
	 * 根据readerNO查询reader
	 * @param readerNO
	 * @return
	 * @throws SQLException
	 */
	public Reader getReaderByID(String readerID) throws SQLException;
	
	/**获取记录条目数
	 * 
	 * @return
	 * @throws SQLException
	 */
	public int getReaderCount() throws SQLException;
	
	/**
	 * 获得页面信息
	 * @param currentPage
	 * @param showRecordNum
	 * @return
	 * @throws SQLException
	 */
	public BasePage getBasePage(int currentPage,int showRecordNum) throws SQLException;
	
	/**
	 * 根据页面确定要显示的记录
	 * @param basePage
	 * @return
	 * @throws SQLException
	 */
	public List<Reader> getReaderByPage(BasePage basePage) throws SQLException;

	
	/**
	 * 根据readerNO获取所有的当前节约的详细信息	 * 
	 * @author 王俊杰	
	 * @param ReaderNO
	 * @return
	 * @throws SQLException
	 */
	List<ReaderBorrowCopyBookAuthority> getReaderCurrentBorrowDetails(int readerNO) throws SQLException;

	
	/**
	 * @param readerID
	 * @return
	 */
	public ArrayList<ReaderBorrowHistoryDto> getReaderBorrowHistoryDtosByreaderNO(int readerNO);


}
